//
//  YQProjectHeadView.m
//  NewRetail
//
//  Created by yuqin on 2019/6/24.
//  Copyright © 2019 yuqin. All rights reserved.
//

#import "YQProjectHeadView.h"

@interface YQProjectHeadView ()

/**
 左边标题
 */
@property (nonatomic, strong) UILabel *titleLeft;

/**
 右边标题
 */
@property (nonatomic, strong) UILabel *titleRight;

@end

@implementation YQProjectHeadView

- (void)setupContentView {
    self.backgroundColor = MainBlueColor;
    [self addSubview:self.incubatorDateLab];
    [self addSubview:self.titleLeft];
    [self addSubview:self.incubatorCoinsTypeLab];
    [self addSubview:self.titleRight];
    [self addSubview:self.earningsLab];
    
    
    [self.incubatorDateLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kMargin_left);
        make.top.mas_equalTo(FIT(20));
        make.size.mas_equalTo(CGSizeMake(ScreenWidth-FIT(32), FIT(20)));
    }];
    
    CGFloat title_W = (ScreenWidth-FIT(32))/2.0;
    [self.titleLeft mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kMargin_left);
        make.top.equalTo(self.incubatorDateLab.mas_bottom).mas_equalTo(FIT(5));
        make.size.mas_equalTo(CGSizeMake(title_W, FIT(20)));
    }];
    
    [self.titleRight mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLeft.mas_right).mas_equalTo(0);
        make.top.equalTo(self.incubatorDateLab.mas_bottom).mas_equalTo(FIT(5));
        make.size.mas_equalTo(CGSizeMake(title_W, FIT(20)));
    }];
    
    [self.incubatorCoinsTypeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kMargin_left);
        make.top.equalTo(self.titleLeft.mas_bottom).mas_equalTo(FIT(5));
        make.size.mas_equalTo(CGSizeMake(title_W, FIT(20)));
    }];
    
    [self.earningsLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.incubatorCoinsTypeLab.mas_right).mas_equalTo(0);
        make.top.equalTo(self.titleRight.mas_bottom).mas_equalTo(FIT(5));
        make.size.mas_equalTo(CGSizeMake(title_W, FIT(20)));
    }];
}

- (UILabel *)incubatorDateLab {
    if (!_incubatorDateLab) {
        _incubatorDateLab = [YQViewFactory labelWithTextColor:WhiteColor textAlignment:NSTextAlignmentLeft fontSize:kTheTitleFont userBold:NO];
        _incubatorDateLab.text = @"孵化器：90个孵化日";
    }
    return _incubatorDateLab;
}

- (UILabel *)titleLeft {
    if (!_titleLeft) {
        _titleLeft = [YQViewFactory labelWithTextColor:WhiteColor textAlignment:NSTextAlignmentLeft fontSize:kTheTitleFont userBold:NO];
        _titleLeft.text = @"孵化币种";
    }
    return _titleLeft;
}

- (UILabel *)incubatorCoinsTypeLab {
    if (!_incubatorCoinsTypeLab) {
        _incubatorCoinsTypeLab = [YQViewFactory labelWithTextColor:WhiteColor textAlignment:NSTextAlignmentLeft fontSize:FIT(20) userBold:YES];
        _incubatorCoinsTypeLab.text = @"WDC";
    }
    return _incubatorCoinsTypeLab;
}

- (UILabel *)titleRight {
    if (!_titleRight) {
        _titleRight = [YQViewFactory labelWithTextColor:WhiteColor textAlignment:NSTextAlignmentLeft fontSize:kTheTitleFont userBold:NO];
        _titleRight.text = @"预期收益率";
    }
    return _titleRight;
}

- (UILabel *)earningsLab {
    if (!_earningsLab) {
        _earningsLab = [YQViewFactory labelWithTextColor:WhiteColor textAlignment:NSTextAlignmentLeft fontSize:FIT(20) userBold:YES];
        _earningsLab.text = @"0.05695%";
    }
    return _earningsLab;
}

@end
